package com.tedu.egspringbootmvc.pojo.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.validation.annotation.Validated;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

@Data
public class UserLoginDTO {
    @NotBlank
    @Pattern(regexp = "^[\\u4e00-\\u9fa5a-zA-Z0-9_]{5,20}$",message = "用户名只能是中文、英文、数字或下划线，5-20位")
    @ApiModelProperty(value = "用户名",required = true,example = "admin")
    private String username;
    @NotBlank
    @Pattern(regexp = "^[a-zA-Z0-9_]{5,80}$",message = "密码只能是英文、数字或下划线，5-80位")
    @ApiModelProperty(value = "123456",required = true,example = "123456")
    private String password;

}
